Repository navigation
Feat/7 estrutura cli - #5
Merged
Merged
Conversation
nando-win
approved these changes
Nov 13, 2026
ariel-sousa
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descrição
Issue relacionada
Motivo da correção (PR adicional)
Alterações realizadas
index.html, se PR Web): não se aplica; nenhuma alteração visual foi realizada.CliApplication.java, com os comandoshelp,health,tokenestatus. A CLI acessa somente a API e não se conecta diretamente ao banco.GET /api/cli/health,POST /api/cli/tokeneGET /api/cli/status. Também foram adicionados autenticação Bearer, retorno HTTP 401 e identificação do cliente CLI nos logs.AppUserDataAccess, registrando eventos JSON da camadadbcom o mesmorequest_idda API quando o comando acessa dados.README.md): adicionadas instruções para iniciar a aplicação, executar os comandos, obter e configurar o token, consultar logs e executar os testes.Infraestrutura e suporte
compose.yaml,CliApplication.java,CliController.java,SecurityConfig.java,RequestIdFilter.java,CliApplicationTest.java,CliApiIntegrationTest.javaeREADME.md.compose.yamlpermite executar a CLI e os testes em contêineres; os arquivos da CLI e da API implementam os comandos e endpoints; a configuração de segurança implementa Bearer e HTTP 401; o filtro registra logs correlacionados; os testes verificam o comportamento implementado; e o README documenta o uso.Endpoints e logs
GET /api/cli/health: público, retorna HTTP 200.POST /api/cli/token: recebe usuário e senha do usuário inicial e retorna um token.GET /api/cli/status: protegido por token Bearer e usado pelo comandostatus.request_idcorrelacionado (quando houver acesso ao banco): os eventos são registrados em uma linha JSON nostdout, comtimestamp,level,layer,client,operation,status,request_idemessage. Senhas e tokens não são registrados.docker compose logs -f app.Autenticação (quando aplicável)
GET /api/cli/statusutilizaAuthorization: Bearer <token>. A CLI lê o token da variável de ambienteFINDMYPACKS_TOKEN.Testes unitários e cobertura
CliApplicationTest.javaeCliApiIntegrationTest.java. A alteração também mantém compatibilidade comRequestIdFilterTest.javae os testes existentes.docker compose --profile test run --build --rm tests.fix(logging): preserva mensagem dos logs web. O resultado integral e a cobertura de 100% devem ser confirmados pelo novo checkCompose CI / compose-tests.Execução integral via Docker Compose
docker compose up --build -d --wait.docker compose --profile cli run --rm cli helpdocker compose --profile cli run --rm cli healthdocker compose --profile cli run --rm cli token findmypacksadmin findmypacksadminFINDMYPACKS_TOKEN:docker compose --profile cli run --rm cli statusdocker compose --profile test run --build --rm tests.Verificação realizada
Web operation completednas operações Web e usarAPI operation completednas operações da CLI.